package com.gome.gop.common;

/**
 * @Title:
 * @Description: 处理异常信息
 * @Author:chengcheng7
 * @Since: 2019/11/6 14:55
 * @Copyright:Copyright (c) 2018 - 2100
 * @Company:gome
 * @Version:1.1.0
 */
public class ExceptionUtils {
    
    /**
     * 获得exception中的堆栈信息字符串
     * 
     * @param e
     * @return
     */
    public static String getExceptionString(Exception e) {
        StackTraceElement[] stackArray = e.getStackTrace();
        StringBuilder stringBuilder = new StringBuilder();
        for (StackTraceElement stackTraceElement : stackArray) {
            stringBuilder.append(stackTraceElement);
            stringBuilder.append("\n");
        }
        return stringBuilder.toString();
    }
    
}
